home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ALPH.{_4 / PCI.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  1KB  |  49 lines

  1. #ifndef __ALPHA_PCI_H
  2. #define __ALPHA_PCI_H
  3.  
  4. #include <linux/config.h>
  5. #include <linux/pci.h>
  6.  
  7.  
  8. /*
  9.  * The following structure is used to manage multiple PCI busses.
  10.  *
  11.  * XXX: We should solve this problem in an architecture independent
  12.  * way, rather than hacking something up here.
  13.  */
  14.  
  15. struct linux_hose_info {
  16.         struct pci_bus                  pci_bus;
  17.     struct linux_hose_info         *next;
  18.     unsigned long                   pci_io_space;
  19.     unsigned long                   pci_mem_space;
  20.     unsigned long                   pci_config_space;
  21.     unsigned long                   pci_sparse_space;
  22.         unsigned int                    pci_first_busno;
  23.         unsigned int                    pci_last_busno;
  24.     unsigned int                    pci_hose_index;
  25. };
  26.  
  27. /* This is indexed by a pseudo- PCI bus number to obtain the real deal.  */
  28. extern struct linux_hose_info *bus2hose[256];
  29.  
  30. /* Create a handle that is OR-ed into the reported I/O space address
  31.    for a device.  We use this later to find the bus a device lives on.  */
  32.  
  33. #if defined(CONFIG_ALPHA_GENERIC) \
  34.     || defined(CONFIG_ALPHA_MCPCIA) \
  35.     || defined(CONFIG_ALPHA_TSUNAMI)
  36.  
  37. #define PCI_HANDLE(bus)   ((bus2hose[bus]->pci_hose_index & 3UL) << 32)
  38. #define DEV_IS_ON_PRIMARY(dev) \
  39.   (bus2hose[(dev)->bus->number]->pci_first_busno == (dev)->bus->number)
  40.  
  41. #else
  42.  
  43. #define PCI_HANDLE(bus)         0
  44. #define DEV_IS_ON_PRIMARY(dev)  ((dev)->bus->number == 0)
  45.  
  46. #endif /* Multiple busses */
  47.  
  48. #endif /* __ALPHA_PCI_H */
  49.